package com.denlaku.longan.controller.impl;

import com.denlaku.longan.controller.SysRoleController;
import com.denlaku.longan.http.Resp;
import com.denlaku.longan.http.Return;
import com.denlaku.longan.service.SysRoleService;
import com.denlaku.longan.vo.SysRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author tianx
 */
@RestController
public class SysRoleControllerImpl implements SysRoleController {
	@Autowired
	private SysRoleService sysRoleService;

	@Override
	public Return<SysRole> get(Long id) {
		SysRole sysRole = sysRoleService.get(id);
		return Resp.success(sysRole);
	}

	@Override
	public Return<List<SysRole>> list() {
		SysRole sysRole = new SysRole();
		List<SysRole> sysRoleList = sysRoleService.list(sysRole);
		return Resp.success(sysRoleList);
	}

}
